<?php

namespace Org\CommonExt;
class ModelExt {
	
		static public function add_or_update($model=null) {
			if($model==null){
				return null;
			}
			
			if (is_string($model->getPk()) && isset($data[$model->getPk()]&&$data[$model->getPk()]>0)) {
				 $result	=	$model->save();
			}else{
				 $result	=	$model->add();
			}

			return $result;
		}
	
}